home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / patch-21.lha / patch-2.1 / configure < prev    next >
Text File  |  1993-06-10  |  31KB  |  1,126 lines

  1. #!/bin/sh
  2. # Guess values for system-dependent variables and create Makefiles.
  3. # Generated automatically using autoconf.
  4. # Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
  5.  
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2, or (at your option)
  9. # any later version.
  10.  
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. # GNU General Public License for more details.
  15.  
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program; if not, write to the Free Software
  18. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19.  
  20. # Usage: configure [--srcdir=DIR] [--host=HOST] [--gas] [--nfp] [--no-create]
  21. #        [--prefix=PREFIX] [--exec-prefix=PREFIX] [--with-PACKAGE] [TARGET]
  22. # Ignores all args except --srcdir, --prefix, --exec-prefix, --no-create, and
  23. # --with-PACKAGE unless this script has special code to handle it.
  24.  
  25.  
  26. for arg
  27. do
  28.   # Handle --exec-prefix with a space before the argument.
  29.   if test x$next_exec_prefix = xyes; then exec_prefix=$arg; next_exec_prefix=
  30.   # Handle --host with a space before the argument.
  31.   elif test x$next_host = xyes; then next_host=
  32.   # Handle --prefix with a space before the argument.
  33.   elif test x$next_prefix = xyes; then prefix=$arg; next_prefix=
  34.   # Handle --srcdir with a space before the argument.
  35.   elif test x$next_srcdir = xyes; then srcdir=$arg; next_srcdir=
  36.   else
  37.     case $arg in
  38.      # For backward compatibility, also recognize exact --exec_prefix.
  39.      -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* | --exe=* | --ex=* | --e=*)
  40.     exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  41.      -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- | --exec | --exe | --ex | --e)
  42.     next_exec_prefix=yes ;;
  43.  
  44.      -gas | --gas | --ga | --g) ;;
  45.  
  46.      -host=* | --host=* | --hos=* | --ho=* | --h=*) ;;
  47.      -host | --host | --hos | --ho | --h)
  48.     next_host=yes ;;
  49.  
  50.      -nfp | --nfp | --nf) ;;
  51.  
  52.      -no-create | --no-create | --no-creat | --no-crea | --no-cre | --no-cr | --no-c | --no- | --no)
  53.         no_create=1 ;;
  54.  
  55.      -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
  56.     prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  57.      -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
  58.     next_prefix=yes ;;
  59.  
  60.      -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
  61.     srcdir=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  62.      -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
  63.     next_srcdir=yes ;;
  64.  
  65.      -with-* | --with-*)
  66.        package=`echo $arg|sed 's/-*with-//'`
  67.        # Delete all the valid chars; see if any are left.
  68.        if test -n "`echo $package|sed 's/[-a-zA-Z0-9_]*//g'`"; then
  69.          echo "configure: $package: invalid package name" >&2; exit 1
  70.        fi
  71.        eval "with_`echo $package|sed s/-/_/g`=1" ;;
  72.  
  73.      -v | -verbose | --verbose | --verbos | --verbo | --verb | --ver | --ve | --v)
  74.        verbose=yes ;;
  75.  
  76.      *) ;;
  77.     esac
  78.   fi
  79. done
  80.  
  81. trap 'rm -f conftest* core; exit 1' 1 3 15
  82.  
  83. # Needed for some versions of `tr' so that character classes in `[]' work.
  84. if test "${LANG+set}" = "set" ; then
  85.    LANG=C
  86. fi
  87.  
  88. rm -f conftest*
  89. compile='${CC-cc} $CFLAGS $DEFS conftest.c -o conftest $LIBS >/dev/null 2>&1'
  90.  
  91. # A filename unique to this package, relative to the directory that
  92. # configure is in, which we can look for to find out if srcdir is correct.
  93. unique_file=patch.c
  94.  
  95. # Find the source files, if location was not specified.
  96. if test -z "$srcdir"; then
  97.   srcdirdefaulted=yes
  98.   # Try the directory containing this script, then `..'.
  99.   prog=$0
  100.   confdir=`echo $prog|sed 's%/[^/][^/]*$%%'`
  101.   test "X$confdir" = "X$prog" && confdir=.
  102.   srcdir=$confdir
  103.   if test ! -r $srcdir/$unique_file; then
  104.     srcdir=..
  105.   fi
  106. fi
  107. if test ! -r $srcdir/$unique_file; then
  108.   if test x$srcdirdefaulted = xyes; then
  109.     echo "configure: Can not find sources in \`${confdir}' or \`..'." 1>&2
  110.   else
  111.     echo "configure: Can not find sources in \`${srcdir}'." 1>&2
  112.   fi
  113.   exit 1
  114. fi
  115. # Preserve a srcdir of `.' to avoid automounter screwups with pwd.
  116. # But we can't avoid them for `..', to make subdirectories work.
  117. case $srcdir in
  118.   .|/*|~*) ;;
  119.   *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
  120. esac
  121.  
  122. # Save the original args to write them into config.status later.
  123. configure_args="$*"
  124.  
  125.  
  126. if test -z "$CC"; then
  127.   # Extract the first word of `gcc', so it can be a program name with args.
  128.   set dummy gcc; word=$2
  129.   echo checking for $word
  130.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  131.   for dir in $PATH; do
  132.     test -z "$dir" && dir=.
  133.     if test -f $dir/$word; then
  134.       CC="gcc"
  135.       break
  136.     fi
  137.   done
  138.   IFS="$saveifs"
  139. fi
  140. test -z "$CC" && CC="cc"
  141. test -n "$CC" -a -n "$verbose" && echo "    setting CC to $CC"
  142.  
  143. # Find out if we are using GNU C, under whatever name.
  144. cat > conftest.c <<EOF
  145. #ifdef __GNUC__
  146.   yes
  147. #endif
  148. EOF
  149. ${CC-cc} -E conftest.c > conftest.out 2>&1
  150. if egrep yes conftest.out >/dev/null 2>&1; then
  151.   GCC=1 # For later tests.
  152. fi
  153. rm -f conftest*
  154.  
  155. echo checking how to run the C preprocessor
  156. if test -z "$CPP"; then
  157.   CPP='${CC-cc} -E'
  158.   cat > conftest.c <<EOF
  159. #include <stdio.h>
  160. EOF
  161. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  162. if test -z "$err"; then
  163.   :
  164. else
  165.   CPP=/lib/cpp
  166. fi
  167. rm -f conftest*
  168. fi
  169.  
  170. echo checking for AIX
  171. cat > conftest.c <<EOF
  172. #ifdef _AIX
  173.   yes
  174. #endif
  175.  
  176. EOF
  177. eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
  178. if egrep "yes" conftest.out >/dev/null 2>&1; then
  179.   {
  180. test -n "$verbose" && \
  181. echo '    defining' _ALL_SOURCE
  182. DEFS="$DEFS -D_ALL_SOURCE=1"
  183. SEDDEFS="${SEDDEFS}\${SEDdA}_ALL_SOURCE\${SEDdB}_ALL_SOURCE\${SEDdC}1\${SEDdD}
  184. \${SEDuA}_ALL_SOURCE\${SEDuB}_ALL_SOURCE\${SEDuC}1\${SEDuD}
  185. \${SEDeA}_ALL_SOURCE\${SEDeB}_ALL_SOURCE\${SEDeC}1\${SEDeD}
  186. "
  187. }
  188.  
  189. fi
  190. rm -f conftest*
  191.  
  192.  
  193. echo checking for minix/config.h
  194. cat > conftest.c <<EOF
  195. #include <minix/config.h>
  196. EOF
  197. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  198. if test -z "$err"; then
  199.   MINIX=1
  200. fi
  201. rm -f conftest*
  202.  
  203. # The Minix shell can't assign to the same variable on the same line!
  204. if test -n "$MINIX"; then
  205.   {
  206. test -n "$verbose" && \
  207. echo '    defining' _POSIX_SOURCE
  208. DEFS="$DEFS -D_POSIX_SOURCE=1"
  209. SEDDEFS="${SEDDEFS}\${SEDdA}_POSIX_SOURCE\${SEDdB}_POSIX_SOURCE\${SEDdC}1\${SEDdD}
  210. \${SEDuA}_POSIX_SOURCE\${SEDuB}_POSIX_SOURCE\${SEDuC}1\${SEDuD}
  211. \${SEDeA}_POSIX_SOURCE\${SEDeB}_POSIX_SOURCE\${SEDeC}1\${SEDeD}
  212. "
  213. }
  214.  
  215.   {
  216. test -n "$verbose" && \
  217. echo '    defining' _POSIX_1_SOURCE to be '2'
  218. DEFS="$DEFS -D_POSIX_1_SOURCE=2"
  219. SEDDEFS="${SEDDEFS}\${SEDdA}_POSIX_1_SOURCE\${SEDdB}_POSIX_1_SOURCE\${SEDdC}2\${SEDdD}
  220. \${SEDuA}_POSIX_1_SOURCE\${SEDuB}_POSIX_1_SOURCE\${SEDuC}2\${SEDuD}
  221. \${SEDeA}_POSIX_1_SOURCE\${SEDeB}_POSIX_1_SOURCE\${SEDeC}2\${SEDeD}
  222. "
  223. }
  224.  
  225.   {
  226. test -n "$verbose" && \
  227. echo '    defining' _MINIX
  228. DEFS="$DEFS -D_MINIX=1"
  229. SEDDEFS="${SEDDEFS}\${SEDdA}_MINIX\${SEDdB}_MINIX\${SEDdC}1\${SEDdD}
  230. \${SEDuA}_MINIX\${SEDuB}_MINIX\${SEDuC}1\${SEDuD}
  231. \${SEDeA}_MINIX\${SEDeB}_MINIX\${SEDeC}1\${SEDeD}
  232. "
  233. }
  234.  
  235. fi
  236.  
  237. echo checking for POSIXized ISC
  238. if test -d /etc/conf/kconfig.d &&
  239.   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
  240. then
  241.   ISC=1 # If later tests want to check for ISC.
  242.   {
  243. test -n "$verbose" && \
  244. echo '    defining' _POSIX_SOURCE
  245. DEFS="$DEFS -D_POSIX_SOURCE=1"
  246. SEDDEFS="${SEDDEFS}\${SEDdA}_POSIX_SOURCE\${SEDdB}_POSIX_SOURCE\${SEDdC}1\${SEDdD}
  247. \${SEDuA}_POSIX_SOURCE\${SEDuB}_POSIX_SOURCE\${SEDuC}1\${SEDuD}
  248. \${SEDeA}_POSIX_SOURCE\${SEDeB}_POSIX_SOURCE\${SEDeC}1\${SEDeD}
  249. "
  250. }
  251.  
  252.   if test -n "$GCC"; then
  253.     CC="$CC -posix"
  254.   else
  255.     CC="$CC -Xp"
  256.   fi
  257. fi
  258.  
  259. prog='/* Ultrix mips cc rejects this.  */
  260. typedef int charset[2]; const charset x;
  261. /* SunOS 4.1.1 cc rejects this.  */
  262. char const *const *ccp;
  263. char **p;
  264. /* AIX XL C 1.02.0.0 rejects this.
  265.    It does not let you subtract one const X* pointer from another in an arm
  266.    of an if-expression whose if-part is not a constant expression */
  267. const char *g = "string";
  268. p = &g + (g ? g-g : 0);
  269. /* HPUX 7.0 cc rejects these. */
  270. ++ccp;
  271. p = (char**) ccp;
  272. ccp = (char const *const *) p;
  273. { /* SCO 3.2v4 cc rejects this.  */
  274.   char *t;
  275.   char const *s = 0 ? (char *) 0 : (char const *) 0;
  276.  
  277.   *t++ = 0;
  278. }
  279. { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
  280.   int x[] = {25,17};
  281.   const int *foo = &x[0];
  282.   ++foo;
  283. }
  284. { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
  285.   typedef const int *iptr;
  286.   iptr p = 0;
  287.   ++p;
  288. }
  289. { /* AIX XL C 1.02.0.0 rejects this saying
  290.      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
  291.   struct s { int j; const int *ap[3]; };
  292.   struct s *b; b->j = 5;
  293. }'
  294. echo checking for working const
  295. cat > conftest.c <<EOF
  296.  
  297. int main() { exit(0); }
  298. int t() { $prog }
  299. EOF
  300. if eval $compile; then
  301.   :
  302. else
  303.   {
  304. test -n "$verbose" && \
  305. echo '    defining' const to be 'empty'
  306. DEFS="$DEFS -Dconst="
  307. SEDDEFS="${SEDDEFS}\${SEDdA}const\${SEDdB}const\${SEDdC}\${SEDdD}
  308. \${SEDuA}const\${SEDuB}const\${SEDuC}\${SEDuD}
  309. \${SEDeA}const\${SEDeB}const\${SEDeC}\${SEDeD}
  310. "
  311. }
  312.  
  313. fi
  314. rm -f conftest*
  315.  
  316. # Make sure to not get the incompatible SysV /etc/install and
  317. # /usr/sbin/install, which might be in PATH before a BSD-like install,
  318. # or the SunOS /usr/etc/install directory, or the AIX /bin/install,
  319. # or the AFS install, which mishandles nonexistent args, or
  320. # /usr/ucb/install on SVR4, which tries to use the nonexistent group
  321. # `staff'.  On most BSDish systems install is in /usr/bin, not /usr/ucb
  322. # anyway.  Sigh.
  323. if test "z${INSTALL}" = "z" ; then
  324.   echo checking for install
  325.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  326.   for dir in $PATH; do
  327.     test -z "$dir" && dir=.
  328.     case $dir in
  329.     /etc|/usr/sbin|/usr/etc|/usr/afsws/bin|/usr/ucb) ;;
  330.     *)
  331.       if test -f $dir/installbsd; then
  332.     INSTALL="$dir/installbsd -c" # OSF1
  333.     INSTALL_PROGRAM='$(INSTALL)'
  334.     INSTALL_DATA='$(INSTALL) -m 644'
  335.     break
  336.       fi
  337.       if test -f $dir/install; then
  338.     if grep dspmsg $dir/install >/dev/null 2>&1; then
  339.       : # AIX
  340.     else
  341.       INSTALL="$dir/install -c"
  342.       INSTALL_PROGRAM='$(INSTALL)'
  343.       INSTALL_DATA='$(INSTALL) -m 644'
  344.       break
  345.     fi
  346.       fi
  347.       ;;
  348.     esac
  349.   done
  350.   IFS="$saveifs"
  351. fi
  352. INSTALL=${INSTALL-cp}
  353. INSTALL_PROGRAM=${INSTALL_PROGRAM-'$(INSTALL)'}
  354. INSTALL_DATA=${INSTALL_DATA-'$(INSTALL)'}
  355.  
  356. echo checking for directory library header
  357. dirheader=
  358. if test -z "$dirheader"; then
  359.   echo checking for dirent.h
  360. cat > conftest.c <<EOF
  361. #include <sys/types.h>
  362. #include <dirent.h>
  363. int main() { exit(0); }
  364. int t() { DIR *dirp = opendir ("/"); }
  365. EOF
  366. if eval $compile; then
  367.   {
  368. test -n "$verbose" && \
  369. echo '    defining' DIRENT
  370. DEFS="$DEFS -DDIRENT=1"
  371. SEDDEFS="${SEDDEFS}\${SEDdA}DIRENT\${SEDdB}DIRENT\${SEDdC}1\${SEDdD}
  372. \${SEDuA}DIRENT\${SEDuB}DIRENT\${SEDuC}1\${SEDuD}
  373. \${SEDeA}DIRENT\${SEDeB}DIRENT\${SEDeC}1\${SEDeD}
  374. "
  375. }
  376.  dirheader=dirent.h
  377. fi
  378. rm -f conftest*
  379. fi
  380. if test -z "$dirheader"; then
  381.   echo checking for sys/ndir.h
  382. cat > conftest.c <<EOF
  383. #include <sys/types.h>
  384. #include <sys/ndir.h>
  385. int main() { exit(0); }
  386. int t() { DIR *dirp = opendir ("/"); }
  387. EOF
  388. if eval $compile; then
  389.   {
  390. test -n "$verbose" && \
  391. echo '    defining' SYSNDIR
  392. DEFS="$DEFS -DSYSNDIR=1"
  393. SEDDEFS="${SEDDEFS}\${SEDdA}SYSNDIR\${SEDdB}SYSNDIR\${SEDdC}1\${SEDdD}
  394. \${SEDuA}SYSNDIR\${SEDuB}SYSNDIR\${SEDuC}1\${SEDuD}
  395. \${SEDeA}SYSNDIR\${SEDeB}SYSNDIR\${SEDeC}1\${SEDeD}
  396. "
  397. }
  398.  dirheader=sys/ndir.h
  399. fi
  400. rm -f conftest*
  401. fi
  402. if test -z "$dirheader"; then
  403.   echo checking for sys/dir.h
  404. cat > conftest.c <<EOF
  405. #include <sys/types.h>
  406. #include <sys/dir.h>
  407. int main() { exit(0); }
  408. int t() { DIR *dirp = opendir ("/"); }
  409. EOF
  410. if eval $compile; then
  411.   {
  412. test -n "$verbose" && \
  413. echo '    defining' SYSDIR
  414. DEFS="$DEFS -DSYSDIR=1"
  415. SEDDEFS="${SEDDEFS}\${SEDdA}SYSDIR\${SEDdB}SYSDIR\${SEDdC}1\${SEDdD}
  416. \${SEDuA}SYSDIR\${SEDuB}SYSDIR\${SEDuC}1\${SEDuD}
  417. \${SEDeA}SYSDIR\${SEDeB}SYSDIR\${SEDeC}1\${SEDeD}
  418. "
  419. }
  420.  dirheader=sys/dir.h
  421. fi
  422. rm -f conftest*
  423. fi
  424. if test -z "$dirheader"; then
  425.   echo checking for ndir.h
  426. cat > conftest.c <<EOF
  427. #include <sys/types.h>
  428. #include <ndir.h>
  429. int main() { exit(0); }
  430. int t() { DIR *dirp = opendir ("/"); }
  431. EOF
  432. if eval $compile; then
  433.   {
  434. test -n "$verbose" && \
  435. echo '    defining' NDIR
  436. DEFS="$DEFS -DNDIR=1"
  437. SEDDEFS="${SEDDEFS}\${SEDdA}NDIR\${SEDdB}NDIR\${SEDdC}1\${SEDdD}
  438. \${SEDuA}NDIR\${SEDuB}NDIR\${SEDuC}1\${SEDuD}
  439. \${SEDeA}NDIR\${SEDeB}NDIR\${SEDeC}1\${SEDeD}
  440. "
  441. }
  442.  dirheader=ndir.h
  443. fi
  444. rm -f conftest*
  445. fi
  446.  
  447. echo checking for closedir return value
  448. cat > conftest.c <<EOF
  449. #include <sys/types.h>
  450. #include <$dirheader>
  451. int closedir(); main() { exit(closedir(opendir(".")) != 0); }
  452. EOF
  453. eval $compile
  454. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  455.   :
  456. else
  457.   {
  458. test -n "$verbose" && \
  459. echo '    defining' VOID_CLOSEDIR
  460. DEFS="$DEFS -DVOID_CLOSEDIR=1"
  461. SEDDEFS="${SEDDEFS}\${SEDdA}VOID_CLOSEDIR\${SEDdB}VOID_CLOSEDIR\${SEDdC}1\${SEDdD}
  462. \${SEDuA}VOID_CLOSEDIR\${SEDuB}VOID_CLOSEDIR\${SEDuC}1\${SEDuD}
  463. \${SEDeA}VOID_CLOSEDIR\${SEDeB}VOID_CLOSEDIR\${SEDeC}1\${SEDeD}
  464. "
  465. }
  466.  
  467. fi
  468. rm -f conftest*
  469.  
  470. if test -z "$dirheader"; then
  471.   {
  472. test -n "$verbose" && \
  473. echo '    defining' NODIR
  474. DEFS="$DEFS -DNODIR=1"
  475. SEDDEFS="${SEDDEFS}\${SEDdA}NODIR\${SEDdB}NODIR\${SEDdC}1\${SEDdD}
  476. \${SEDuA}NODIR\${SEDuB}NODIR\${SEDuC}1\${SEDuD}
  477. \${SEDeA}NODIR\${SEDeB}NODIR\${SEDeC}1\${SEDeD}
  478. "
  479. }
  480.  
  481. fi
  482. echo checking for return type of signal handlers
  483. cat > conftest.c <<EOF
  484. #include <sys/types.h>
  485. #include <signal.h>
  486. #ifdef signal
  487. #undef signal
  488. #endif
  489. extern void (*signal ()) ();
  490. int main() { exit(0); }
  491. int t() { int i; }
  492. EOF
  493. if eval $compile; then
  494.   {
  495. test -n "$verbose" && \
  496. echo '    defining' RETSIGTYPE to be 'void'
  497. DEFS="$DEFS -DRETSIGTYPE=void"
  498. SEDDEFS="${SEDDEFS}\${SEDdA}RETSIGTYPE\${SEDdB}RETSIGTYPE\${SEDdC}void\${SEDdD}
  499. \${SEDuA}RETSIGTYPE\${SEDuB}RETSIGTYPE\${SEDuC}void\${SEDuD}
  500. \${SEDeA}RETSIGTYPE\${SEDeB}RETSIGTYPE\${SEDeC}void\${SEDeD}
  501. "
  502. }
  503.  
  504. else
  505.   {
  506. test -n "$verbose" && \
  507. echo '    defining' RETSIGTYPE to be 'int'
  508. DEFS="$DEFS -DRETSIGTYPE=int"
  509. SEDDEFS="${SEDDEFS}\${SEDdA}RETSIGTYPE\${SEDdB}RETSIGTYPE\${SEDdC}int\${SEDdD}
  510. \${SEDuA}RETSIGTYPE\${SEDuB}RETSIGTYPE\${SEDuC}int\${SEDuD}
  511. \${SEDeA}RETSIGTYPE\${SEDeB}RETSIGTYPE\${SEDeC}int\${SEDeD}
  512. "
  513. }
  514.  
  515. fi
  516. rm -f conftest*
  517.  
  518.  
  519. echo checking for ANSI C header files
  520. cat > conftest.c <<EOF
  521. #include <stdlib.h>
  522. #include <stdarg.h>
  523. #include <string.h>
  524. #include <float.h>
  525. EOF
  526. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  527. if test -z "$err"; then
  528.   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
  529. echo '#include <string.h>' > conftest.c
  530. eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
  531. if egrep "memchr" conftest.out >/dev/null 2>&1; then
  532.   # SGI's /bin/cc from Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
  533. cat > conftest.c <<EOF
  534. #include <ctype.h>
  535. #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
  536. #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
  537. #define XOR(e,f) (((e) && !(f)) || (!(e) && (f)))
  538. int main () { int i; for (i = 0; i < 256; i++)
  539. if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
  540. exit (0); }
  541.  
  542. EOF
  543. eval $compile
  544. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  545.   {
  546. test -n "$verbose" && \
  547. echo '    defining' STDC_HEADERS
  548. DEFS="$DEFS -DSTDC_HEADERS=1"
  549. SEDDEFS="${SEDDEFS}\${SEDdA}STDC_HEADERS\${SEDdB}STDC_HEADERS\${SEDdC}1\${SEDdD}
  550. \${SEDuA}STDC_HEADERS\${SEDuB}STDC_HEADERS\${SEDuC}1\${SEDuD}
  551. \${SEDeA}STDC_HEADERS\${SEDeB}STDC_HEADERS\${SEDeC}1\${SEDeD}
  552. "
  553. }
  554.  
  555. fi
  556. rm -f conftest*
  557. fi
  558. rm -f conftest*
  559.  
  560. fi
  561. rm -f conftest*
  562.  
  563. echo checking for unistd.h
  564. cat > conftest.c <<EOF
  565. #include <unistd.h>
  566. EOF
  567. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  568. if test -z "$err"; then
  569.   {
  570. test -n "$verbose" && \
  571. echo '    defining' HAVE_UNISTD_H
  572. DEFS="$DEFS -DHAVE_UNISTD_H=1"
  573. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_UNISTD_H\${SEDdB}HAVE_UNISTD_H\${SEDdC}1\${SEDdD}
  574. \${SEDuA}HAVE_UNISTD_H\${SEDuB}HAVE_UNISTD_H\${SEDuC}1\${SEDuD}
  575. \${SEDeA}HAVE_UNISTD_H\${SEDeB}HAVE_UNISTD_H\${SEDeC}1\${SEDeD}
  576. "
  577. }
  578.  
  579. fi
  580. rm -f conftest*
  581.  
  582. for hdr in string.h fcntl.h
  583. do
  584. trhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'`
  585. echo checking for ${hdr}
  586. cat > conftest.c <<EOF
  587. #include <${hdr}>
  588. EOF
  589. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  590. if test -z "$err"; then
  591.   {
  592. test -n "$verbose" && \
  593. echo '    defining' ${trhdr}
  594. DEFS="$DEFS -D${trhdr}=1"
  595. SEDDEFS="${SEDDEFS}\${SEDdA}${trhdr}\${SEDdB}${trhdr}\${SEDdC}1\${SEDdD}
  596. \${SEDuA}${trhdr}\${SEDuB}${trhdr}\${SEDuC}1\${SEDuD}
  597. \${SEDeA}${trhdr}\${SEDeB}${trhdr}\${SEDeC}1\${SEDeD}
  598. "
  599. }
  600.  
  601. fi
  602. rm -f conftest*
  603. done
  604.  
  605. for func in rename
  606. do
  607. echo checking for ${func}
  608. cat > conftest.c <<EOF
  609.  
  610. int main() { exit(0); }
  611. int t() { /* The GNU C library defines this for functions which it implements
  612.     to always fail with ENOSYS.  Some functions are actually named
  613.     something starting with __ and the normal name is an alias.  */
  614. #if defined (__stub_${func}) || defined (__stub___${func})
  615. choke me
  616. #else
  617. /* Override any gcc2 internal prototype to avoid an error.  */
  618. extern char ${func}(); ${func}();
  619. #endif
  620.  }
  621. EOF
  622. if eval $compile; then
  623.   :
  624. else
  625.   LIBOBJS="$LIBOBJS ${func}.o"
  626. test -n "$verbose" && echo "    using ${func}.o instead"
  627. fi
  628. rm -f conftest*
  629.  
  630. done
  631.  
  632. for func in pathconf strerror
  633. do
  634. trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
  635. echo checking for ${func}
  636. cat > conftest.c <<EOF
  637. #include <ctype.h>
  638. int main() { exit(0); }
  639. int t() { 
  640. /* The GNU C library defines this for functions which it implements
  641.     to always fail with ENOSYS.  Some functions are actually named
  642.     something starting with __ and the normal name is an alias.  */
  643. #if defined (__stub_${func}) || defined (__stub___${func})
  644. choke me
  645. #else
  646. /* Override any gcc2 internal prototype to avoid an error.  */
  647. extern char ${func}(); ${func}();
  648. #endif
  649.  }
  650. EOF
  651. if eval $compile; then
  652.   {
  653. test -n "$verbose" && \
  654. echo '    defining' ${trfunc}
  655. DEFS="$DEFS -D${trfunc}=1"
  656. SEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD}
  657. \${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD}
  658. \${SEDeA}${trfunc}\${SEDeB}${trfunc}\${SEDeC}1\${SEDeD}
  659. "
  660. }
  661.  
  662. fi
  663. rm -f conftest*
  664. done
  665.  
  666. # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
  667. # for constant arguments.  Useless!
  668. echo checking for working alloca.h
  669. cat > conftest.c <<EOF
  670. #include <alloca.h>
  671. int main() { exit(0); }
  672. int t() { char *p = alloca(2 * sizeof(int)); }
  673. EOF
  674. if eval $compile; then
  675.   {
  676. test -n "$verbose" && \
  677. echo '    defining' HAVE_ALLOCA_H
  678. DEFS="$DEFS -DHAVE_ALLOCA_H=1"
  679. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_ALLOCA_H\${SEDdB}HAVE_ALLOCA_H\${SEDdC}1\${SEDdD}
  680. \${SEDuA}HAVE_ALLOCA_H\${SEDuB}HAVE_ALLOCA_H\${SEDuC}1\${SEDuD}
  681. \${SEDeA}HAVE_ALLOCA_H\${SEDeB}HAVE_ALLOCA_H\${SEDeC}1\${SEDeD}
  682. "
  683. }
  684.  
  685. fi
  686. rm -f conftest*
  687.  
  688. decl="#ifdef __GNUC__
  689. #define alloca __builtin_alloca
  690. #else
  691. #if HAVE_ALLOCA_H
  692. #include <alloca.h>
  693. #else
  694. #ifdef _AIX
  695.  #pragma alloca
  696. #else
  697. char *alloca ();
  698. #endif
  699. #endif
  700. #endif
  701. "
  702. echo checking for alloca
  703. cat > conftest.c <<EOF
  704. $decl
  705. int main() { exit(0); }
  706. int t() { char *p = (char *) alloca(1); }
  707. EOF
  708. if eval $compile; then
  709.   :
  710. else
  711.   alloca_missing=1
  712. cat > conftest.c <<EOF
  713.  
  714. #if defined(CRAY) && ! defined(CRAY2)
  715. winnitude
  716. #else
  717. lossage
  718. #endif
  719.  
  720. EOF
  721. eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
  722. if egrep "winnitude" conftest.out >/dev/null 2>&1; then
  723.   echo checking for _getb67
  724. cat > conftest.c <<EOF
  725. #include <ctype.h>
  726. int main() { exit(0); }
  727. int t() { 
  728. /* The GNU C library defines this for functions which it implements
  729.     to always fail with ENOSYS.  Some functions are actually named
  730.     something starting with __ and the normal name is an alias.  */
  731. #if defined (__stub__getb67) || defined (__stub____getb67)
  732. choke me
  733. #else
  734. /* Override any gcc2 internal prototype to avoid an error.  */
  735. extern char _getb67(); _getb67();
  736. #endif
  737.  }
  738. EOF
  739. if eval $compile; then
  740.   {
  741. test -n "$verbose" && \
  742. echo '    defining' CRAY_STACKSEG_END to be '_getb67'
  743. DEFS="$DEFS -DCRAY_STACKSEG_END=_getb67"
  744. SEDDEFS="${SEDDEFS}\${SEDdA}CRAY_STACKSEG_END\${SEDdB}CRAY_STACKSEG_END\${SEDdC}_getb67\${SEDdD}
  745. \${SEDuA}CRAY_STACKSEG_END\${SEDuB}CRAY_STACKSEG_END\${SEDuC}_getb67\${SEDuD}
  746. \${SEDeA}CRAY_STACKSEG_END\${SEDeB}CRAY_STACKSEG_END\${SEDeC}_getb67\${SEDeD}
  747. "
  748. }
  749.  
  750. else
  751.   echo checking for GETB67
  752. cat > conftest.c <<EOF
  753. #include <ctype.h>
  754. int main() { exit(0); }
  755. int t() { 
  756. /* The GNU C library defines this for functions which it implements
  757.     to always fail with ENOSYS.  Some functions are actually named
  758.     something starting with __ and the normal name is an alias.  */
  759. #if defined (__stub_GETB67) || defined (__stub___GETB67)
  760. choke me
  761. #else
  762. /* Override any gcc2 internal prototype to avoid an error.  */
  763. extern char GETB67(); GETB67();
  764. #endif
  765.  }
  766. EOF
  767. if eval $compile; then
  768.   {
  769. test -n "$verbose" && \
  770. echo '    defining' CRAY_STACKSEG_END to be 'GETB67'
  771. DEFS="$DEFS -DCRAY_STACKSEG_END=GETB67"
  772. SEDDEFS="${SEDDEFS}\${SEDdA}CRAY_STACKSEG_END\${SEDdB}CRAY_STACKSEG_END\${SEDdC}GETB67\${SEDdD}
  773. \${SEDuA}CRAY_STACKSEG_END\${SEDuB}CRAY_STACKSEG_END\${SEDuC}GETB67\${SEDuD}
  774. \${SEDeA}CRAY_STACKSEG_END\${SEDeB}CRAY_STACKSEG_END\${SEDeC}GETB67\${SEDeD}
  775. "
  776. }
  777.  
  778. else
  779.   echo checking for getb67
  780. cat > conftest.c <<EOF
  781. #include <ctype.h>
  782. int main() { exit(0); }
  783. int t() { 
  784. /* The GNU C library defines this for functions which it implements
  785.     to always fail with ENOSYS.  Some functions are actually named
  786.     something starting with __ and the normal name is an alias.  */
  787. #if defined (__stub_getb67) || defined (__stub___getb67)
  788. choke me
  789. #else
  790. /* Override any gcc2 internal prototype to avoid an error.  */
  791. extern char getb67(); getb67();
  792. #endif
  793.  }
  794. EOF
  795. if eval $compile; then
  796.   {
  797. test -n "$verbose" && \
  798. echo '    defining' CRAY_STACKSEG_END to be 'getb67'
  799. DEFS="$DEFS -DCRAY_STACKSEG_END=getb67"
  800. SEDDEFS="${SEDDEFS}\${SEDdA}CRAY_STACKSEG_END\${SEDdB}CRAY_STACKSEG_END\${SEDdC}getb67\${SEDdD}
  801. \${SEDuA}CRAY_STACKSEG_END\${SEDuB}CRAY_STACKSEG_END\${SEDuC}getb67\${SEDuD}
  802. \${SEDeA}CRAY_STACKSEG_END\${SEDeB}CRAY_STACKSEG_END\${SEDeC}getb67\${SEDeD}
  803. "
  804. }
  805.  
  806. fi
  807. rm -f conftest*
  808.  
  809. fi
  810. rm -f conftest*
  811.  
  812. fi
  813. rm -f conftest*
  814.  
  815. fi
  816. rm -f conftest*
  817.  
  818.  
  819. fi
  820. rm -f conftest*
  821.  
  822. if test -n "$alloca_missing"; then
  823.   # The SVR3 libPW and SVR4 libucb both contain incompatible functions
  824.   # that cause trouble.  Some versions do not even contain alloca or
  825.   # contain a buggy version.  If you still want to use their alloca,
  826.   # use ar to extract alloca.o from them instead of compiling alloca.c.
  827.   ALLOCA=alloca.o
  828.  
  829.   echo 'checking stack direction for C alloca'
  830.   echo checking whether cross-compiling
  831. # If we cannot run a trivial program, we must be cross compiling.
  832. cat > conftest.c <<EOF
  833. main(){exit(0);}
  834. EOF
  835. eval $compile
  836. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  837.   :
  838. else
  839.   cross_compiling=1
  840. fi
  841. rm -f conftest*
  842.  
  843. if test -n "$cross_compiling"
  844. then
  845.   {
  846. test -n "$verbose" && \
  847. echo '    defining' STACK_DIRECTION to be '0'
  848. DEFS="$DEFS -DSTACK_DIRECTION=0"
  849. SEDDEFS="${SEDDEFS}\${SEDdA}STACK_DIRECTION\${SEDdB}STACK_DIRECTION\${SEDdC}0\${SEDdD}
  850. \${SEDuA}STACK_DIRECTION\${SEDuB}STACK_DIRECTION\${SEDuC}0\${SEDuD}
  851. \${SEDeA}STACK_DIRECTION\${SEDeB}STACK_DIRECTION\${SEDeC}0\${SEDeD}
  852. "
  853. }
  854.  
  855. else
  856. cat > conftest.c <<EOF
  857. find_stack_direction ()
  858. {
  859.   static char *addr = 0;
  860.   auto char dummy;
  861.   if (addr == 0)
  862.     {
  863.       addr = &dummy;
  864.       return find_stack_direction ();
  865.     }
  866.   else
  867.     return (&dummy > addr) ? 1 : -1;
  868. }
  869. main ()
  870. {
  871.   exit (find_stack_direction() < 0);
  872. }
  873. EOF
  874. eval $compile
  875. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  876.   {
  877. test -n "$verbose" && \
  878. echo '    defining' STACK_DIRECTION to be '1'
  879. DEFS="$DEFS -DSTACK_DIRECTION=1"
  880. SEDDEFS="${SEDDEFS}\${SEDdA}STACK_DIRECTION\${SEDdB}STACK_DIRECTION\${SEDdC}1\${SEDdD}
  881. \${SEDuA}STACK_DIRECTION\${SEDuB}STACK_DIRECTION\${SEDuC}1\${SEDuD}
  882. \${SEDeA}STACK_DIRECTION\${SEDeB}STACK_DIRECTION\${SEDeC}1\${SEDeD}
  883. "
  884. }
  885.  
  886. else
  887.   {
  888. test -n "$verbose" && \
  889. echo '    defining' STACK_DIRECTION to be '-1'
  890. DEFS="$DEFS -DSTACK_DIRECTION=-1"
  891. SEDDEFS="${SEDDEFS}\${SEDdA}STACK_DIRECTION\${SEDdB}STACK_DIRECTION\${SEDdC}-1\${SEDdD}
  892. \${SEDuA}STACK_DIRECTION\${SEDuB}STACK_DIRECTION\${SEDuC}-1\${SEDuD}
  893. \${SEDeA}STACK_DIRECTION\${SEDeB}STACK_DIRECTION\${SEDeC}-1\${SEDeD}
  894. "
  895. }
  896.  
  897. fi
  898. fi
  899. rm -f conftest*
  900. fi
  901.  
  902. echo checking for long file names
  903. lost=false
  904. # Test for long file names in all the places we know might matter:
  905. #      .        the current directory, where building will happen
  906. #      /tmp        where it might want to write temporary files
  907. #      /usr/tmp        likewise
  908. #      $prefix        where we will be installing things
  909. #      $exec_prefix    likewise
  910. for dir in . /tmp /usr/tmp $prefix $exec_prefix ; do
  911.   (echo 1 > $dir/conftest9012345) 2>/dev/null
  912.   (echo 2 > $dir/conftest9012346) 2>/dev/null
  913.   val=`cat $dir/conftest9012345 2>/dev/null`
  914.   test -f $dir/conftest9012345 && test "$val" = 1 || lost=true
  915.   rm -f $dir/conftest9012345 $dir/conftest9012346
  916. done
  917. $lost || {
  918. test -n "$verbose" && \
  919. echo '    defining' HAVE_LONG_FILE_NAMES
  920. DEFS="$DEFS -DHAVE_LONG_FILE_NAMES=1"
  921. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_LONG_FILE_NAMES\${SEDdB}HAVE_LONG_FILE_NAMES\${SEDdC}1\${SEDdD}
  922. \${SEDuA}HAVE_LONG_FILE_NAMES\${SEDuB}HAVE_LONG_FILE_NAMES\${SEDuC}1\${SEDuD}
  923. \${SEDeA}HAVE_LONG_FILE_NAMES\${SEDeB}HAVE_LONG_FILE_NAMES\${SEDeC}1\${SEDeD}
  924. "
  925. }
  926.  
  927.  
  928. echo checking for Xenix
  929. cat > conftest.c <<EOF
  930. #if defined(M_XENIX) && !defined(M_UNIX)
  931.   yes
  932. #endif
  933.  
  934. EOF
  935. eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
  936. if egrep "yes" conftest.out >/dev/null 2>&1; then
  937.   XENIX=1
  938. fi
  939. rm -f conftest*
  940.  
  941. if test -n "$XENIX"; then
  942.   LIBS="$LIBS -lx"
  943.   case "$DEFS" in
  944.   *SYSNDIR*) ;;
  945.   *) LIBS="-ldir $LIBS" ;; # Make sure -ldir precedes any -lx.
  946.   esac
  947. fi
  948.  
  949. if test -n "$prefix"; then
  950.   test -z "$exec_prefix" && exec_prefix='${prefix}'
  951.   prsub="s%^prefix\\([     ]*\\)=\\([     ]*\\).*$%prefix\\1=\\2$prefix%"
  952. fi
  953. if test -n "$exec_prefix"; then
  954.   prsub="$prsub
  955. s%^exec_prefix\\([     ]*\\)=\\([     ]*\\).*$%exec_prefix\\1=\\2$exec_prefix%"
  956. fi
  957. cat >conftest.def <<EOF
  958. $DEFS
  959. EOF
  960. escape_ampersand_and_backslash='s%[&\\]%\\&%g'
  961. DEFS=`sed "$escape_ampersand_and_backslash" <conftest.def`
  962. rm -f conftest.def
  963.  
  964. trap 'rm -f config.status; exit 1' 1 3 15
  965. echo creating config.status
  966. rm -f config.status
  967. cat > config.status <<EOF
  968. #!/bin/sh
  969. # Generated automatically by configure.
  970. # Run this file to recreate the current configuration.
  971. # This directory was configured as follows,
  972. # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
  973. #
  974. # $0 $configure_args
  975.  
  976. for arg
  977. do
  978.   case "\$arg" in
  979.     -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  980.     exec /bin/sh $0 $configure_args ;;
  981.     *) echo "Usage: config.status --recheck" 2>&1; exit 1 ;;
  982.   esac
  983. done
  984.  
  985. trap 'rm -f Makefile config.h conftest*; exit 1' 1 3 15
  986. CC='$CC'
  987. CPP='$CPP'
  988. INSTALL='$INSTALL'
  989. INSTALL_PROGRAM='$INSTALL_PROGRAM'
  990. INSTALL_DATA='$INSTALL_DATA'
  991. LIBOBJS='$LIBOBJS'
  992. ALLOCA='$ALLOCA'
  993. LIBS='$LIBS'
  994. srcdir='$srcdir'
  995. prefix='$prefix'
  996. exec_prefix='$exec_prefix'
  997. prsub='$prsub'
  998. EOF
  999. cat >> config.status <<\EOF
  1000.  
  1001. top_srcdir=$srcdir
  1002.  
  1003. # Allow make-time overrides of the generated file list.
  1004. test -n "$gen_files" || gen_files="Makefile"
  1005.  
  1006. for file in .. $gen_files; do if [ "x$file" != "x.." ]; then
  1007.   srcdir=$top_srcdir
  1008.   # Remove last slash and all that follows it.  Not all systems have dirname.
  1009.   dir=`echo $file|sed 's%/[^/][^/]*$%%'`
  1010.   if test "$dir" != "$file"; then
  1011.     test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
  1012.     test ! -d $dir && mkdir $dir
  1013.   fi
  1014.   echo creating $file
  1015.   rm -f $file
  1016.   echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file
  1017.   sed -e "
  1018. $prsub
  1019. s%@CC@%$CC%g
  1020. s%@CPP@%$CPP%g
  1021. s%@INSTALL@%$INSTALL%g
  1022. s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
  1023. s%@INSTALL_DATA@%$INSTALL_DATA%g
  1024. s%@LIBOBJS@%$LIBOBJS%g
  1025. s%@ALLOCA@%$ALLOCA%g
  1026. s%@LIBS@%$LIBS%g
  1027. s%@srcdir@%$srcdir%g
  1028. s%@DEFS@%-DHAVE_CONFIG_H%" $top_srcdir/${file}.in >> $file
  1029. fi; done
  1030. test -n "$gen_config" || gen_config=config.h
  1031. echo creating $gen_config
  1032. # These sed commands are put into SEDDEFS when defining a macro.
  1033. # They are broken into pieces to make the sed script easier to manage.
  1034. # They are passed to sed as "A NAME B NAME C VALUE D", where NAME
  1035. # is the cpp macro being defined and VALUE is the value it is being given.
  1036. # Each defining turns into a single global substitution command.
  1037. #
  1038. # SEDd sets the value in "#define NAME VALUE" lines.
  1039. SEDdA='s@^\([     ]*\)#\([     ]*define[     ][     ]*\)'
  1040. SEDdB='\([     ][     ]*\)[^     ]*@\1#\2'
  1041. SEDdC='\3'
  1042. SEDdD='@g'
  1043. # SEDu turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
  1044. SEDuA='s@^\([     ]*\)#\([     ]*\)undef\([     ][     ]*\)'
  1045. SEDuB='\([     ]\)@\1#\2define\3'
  1046. SEDuC=' '
  1047. SEDuD='\4@g'
  1048. # SEDe turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
  1049. SEDeA='s@^\([     ]*\)#\([     ]*\)undef\([     ][     ]*\)'
  1050. SEDeB='$@\1#\2define\3'
  1051. SEDeC=' '
  1052. SEDeD='@g'
  1053. rm -f conftest.sed
  1054. EOF
  1055. # Turn off quoting long enough to insert the sed commands.
  1056. rm -f conftest.sh
  1057. cat > conftest.sh <<EOF
  1058. $SEDDEFS
  1059. EOF
  1060.  
  1061. # Maximum number of lines to put in a single here document.
  1062. maxshlines=9
  1063.  
  1064. # Break up $SEDDEFS (now in conftest.sh) because some shells have a limit
  1065. # on the size of here documents.
  1066.  
  1067. while :
  1068. do
  1069.   lines=`grep -c . conftest.sh`
  1070.   if test -z "$lines" || test "$lines" -eq 0; then break; fi
  1071.   rm -f conftest.s1 conftest.s2
  1072.   sed ${maxshlines}q conftest.sh > conftest.s1 # Like head -20.
  1073.   sed 1,${maxshlines}d conftest.sh > conftest.s2 # Like tail +21.
  1074.   # Write a limited-size here document to append to conftest.sed.
  1075.   echo 'cat >> conftest.sed <<CONFEOF' >> config.status
  1076.   cat conftest.s1 >> config.status
  1077.   echo 'CONFEOF' >> config.status
  1078.   rm -f conftest.s1 conftest.sh
  1079.   mv conftest.s2 conftest.sh
  1080. done
  1081. rm -f conftest.sh
  1082.  
  1083. # Now back to your regularly scheduled config.status.
  1084. cat >> config.status <<\EOF
  1085. # This sed command replaces #undef's with comments.  This is necessary, for
  1086. # example, in the case of _POSIX_SOURCE, which is predefined and required
  1087. # on some systems where configure will not decide to define it in
  1088. # config.h.
  1089. cat >> conftest.sed <<\CONFEOF
  1090. s,^[     ]*#[     ]*undef[     ][     ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
  1091. CONFEOF
  1092. rm -f conftest.h
  1093. # Break up the sed commands because old seds have small limits.
  1094. maxsedlines=20
  1095. cp $top_srcdir/$gen_config.in conftest.h1
  1096. while :
  1097. do
  1098.   lines=`grep -c . conftest.sed`
  1099.   if test -z "$lines" || test "$lines" -eq 0; then break; fi
  1100.   rm -f conftest.s1 conftest.s2 conftest.h2
  1101.   sed ${maxsedlines}q conftest.sed > conftest.s1 # Like head -20.
  1102.   sed 1,${maxsedlines}d conftest.sed > conftest.s2 # Like tail +21.
  1103.   sed -f conftest.s1 < conftest.h1 > conftest.h2
  1104.   rm -f conftest.s1 conftest.h1 conftest.sed
  1105.   mv conftest.h2 conftest.h1
  1106.   mv conftest.s2 conftest.sed
  1107. done
  1108. rm -f conftest.sed conftest.h
  1109. echo "/* $gen_config.  Generated automatically by configure.  */" > conftest.h
  1110. cat conftest.h1 >> conftest.h
  1111. rm -f conftest.h1
  1112. if cmp -s $gen_config conftest.h 2>/dev/null; then
  1113.   # The file exists and we would not be changing it.
  1114.   rm -f conftest.h
  1115. else
  1116.   rm -f $gen_config
  1117.   mv conftest.h $gen_config
  1118. fi
  1119.  
  1120.  
  1121. exit 0
  1122. EOF
  1123. chmod +x config.status
  1124. test -n "$no_create" || ./config.status
  1125.  
  1126.